.\" Copyright (c) 2003
.\"	The University of Guelph.  All rights reserved.
.\"
.\" This software was written by Rick Macklem and was derived in part from
.\" software in various BSD releases covered by the
.\" subsequent copyright notices.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" It is also requested that vendors of products using all or part of this
.\" software acknowledge that their products are based upon open source
.\" written by Rick Macklem at the University of Guelph.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF GUELPH ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OF GUELPH BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.Dd November 13, 2003
.Dt NFSUSERD 8
.Os
.Sh NAME
.Nm nfsuserd
.Nd load user and group information into the kernel for
.Tn NFSv4
services
.Sh SYNOPSIS
.Nm nfsuserd
.Op Fl domain Ar domain_name
.Op Fl usertimeout Ar minutes
.Op Fl usermax Ar max_cache_size
.Op Fl verbose
.Op Fl force
.Op Fl kext
.Op Fl cbd
.Op Fl iod
.Op Ar num_servers
.Sh DESCRIPTION
.Nm
loads user and group information into the kernel for NFSv4. It is a first
attempt at what should be an integral part of the password and group
database maintenance services.
It must be running for NFSv4 to function correctly, either client or server.
.Pp
Upon startup, it loads the machines DNS domain name, plus timeout and
cache size limit into the kernel. Then, it preloads the cache with group
and user information, up to the cache size limit. It forks off N children
(default 4), that service requests from the kernel for cache misses. The
master server is there for the sole purpose of killing off the slaves.
To stop the nfsuserd, send a SIGTERM to the master server.
.Pp
The following options are available:
.Bl -tag -width Ds
.It Fl domain Ar domain_name
This option allows you to override the default DNS domain name, which
is acquired by taking either the suffix on the machine's hostname or,
if that name is not a fully qualified host name, the official name as
reported by
.Xr gethostbyname 3 .
.It Fl usertimeout Ar minutes
Overrides the default timeout for cache entries, in minutes. If the
timeout is specified as 0, cache entries never time out. The longer the
time out, the better the performance, but the longer it takes for replaced
entries to be seen. If your user/group database management system almost
never re-uses the same names or id numbers, a large timeout is recommended.
The default is 60 minutes.
.It Fl usermax Ar max_cache_size
Overrides the default upper bound on the cache size. The larger the cache,
the more kernel memory is used, but the better the performance. If your
system can afford the memory use, make this the sum of the number of
entries in your group and password databases.
The default is 200 entries.
.It Fl verbose
When set, the server logs a bunch of information to syslog.
.It Fl force
When set, forces the daemon to start even if it seems to be running
already. This might be necessary if the daemon died off unexpectedly.
.It Fl kext
When set, a child is forked off to do a kextload. This is only used
for Darwin, to load the newnfs kext.
.It Fl cbd
When set, a child is forked off to run the nfscbd daemon. Used for
Darwin, so that it is started after this daemon.
.It Fl iod
When set, a child is forked off to run the newnfsiod daemon. Used for
Darwin, so that it is started after this daemon.
.It Ar num_servers
Specifies how many servers to create (max 20).
The default of 4 may be sufficient. You should run enough servers, so that
.Xr ps 1
shows almost no running time for one or two of the slaves after the system
has been running for a long period. Running too few will have a major
performance impact, whereas running too many will only tie up some resources,
such as a process table entry and swap space.
.El
.Sh SEE ALSO
.Xr group 5 ,
.Xr passwd 5 ,
.Xr getpwent 3 ,
.Xr getgrent 3 ,
.Xr newnfsd 8 ,
.Xr gssd 8 .
.Sh HISTORY
The
.Nm
utility was introduced with the NFSv4 support.
.Sh BUGS
The
.Nm
use
.Xr getgrent 3
and
.Xr getpwent 3
library calls to resolve requests and will hang if the servers handling
those requests fail. See
.Xr group 5
and
.Xr passwd 5
for more information on how the databases are accessed.
